
function expandCollapse(id)
{
	if(document.getElementById('tdDetails'+id).style.display=='')
	{
		document.getElementById('tdDetails'+id).style.display='none';
		document.getElementById('plus'+id).style.display='';
		document.getElementById('minus'+id).style.display='none';
	}
	else
	{
		document.getElementById('tdDetails'+id).style.display='';
		document.getElementById('plus'+id).style.display='none';
		document.getElementById('minus'+id).style.display='';
	}
}
function showPriceVal(clicks,price,id)
{
// alert(clicks);alert(price);alert(id);
	var totPrice = parseInt(clicks)*parseFloat(price);
	document.getElementById('spanTotCost'+id).innerHTML = '$'+format_numberex(totPrice,2);
	document.getElementById('txtTotalCost'+id).value = clicks;
}
function format_numberex(pnumber,decimals)
{
	if (isNaN(pnumber)) { return 0};
	if (pnumber=='') { return 0};
	
	var snum = new String(pnumber);
	var sec = snum.split('.');
	var whole = parseFloat(sec[0]);
	var result = '';
	
	if(sec.length > 1){
		var dec = new String(sec[1]);
		dec = String(parseFloat(sec[1])/Math.pow(10,(dec.length - decimals)));
		dec = String(whole + Math.round(parseFloat(dec))/Math.pow(10,decimals));
		var dot = dec.indexOf('.');
		if(dot == -1){
			dec += '.'; 
			dot = dec.indexOf('.');
		}
		while(dec.length <= dot + decimals) { dec += '0'; }
		result = dec;
	} else{
		var dot;
		var dec = new String(whole);
		dec += '.';
		dot = dec.indexOf('.');		
		while(dec.length <= dot + decimals) { dec += '0'; }
		result = dec;
	}	
	return result;
}
function showAll(minid,maxid)
{var i;
	for(i=minid;i<=maxid;i++)
	{
		
		if(document.getElementById('tdDetails'+i)!=null)
		{
		document.getElementById('tdDetails'+i).style.display='';
		document.getElementById('plus'+i).style.display='none';
		document.getElementById('minus'+i).style.display='';
		}
	}
}
function closeAll(minid,maxid)
{
	for(var i=minid;i<=maxid;i++)
	{
		if(document.getElementById('tdDetails'+i)!=null)
		{
		document.getElementById('tdDetails'+i).style.display='none';
		document.getElementById('plus'+i).style.display='';
		document.getElementById('minus'+i).style.display='none';}
	}
}
function AcceptDigits(objtextbox)
{
var exp = /[^\d]/g;
objtextbox.value = objtextbox.value.replace(exp,'');
}
